module.exports = {
  webpack: {
    configure: (webpackConfig) => {
      // 禁用哈希
      webpackConfig.output.filename = 'static/js/[name].js';
      webpackConfig.output.chunkFilename = 'static/js/[name].chunk.js';
 
      // 禁用 JS 压缩
      if (webpackConfig.optimization) {
        webpackConfig.optimization.minimize = false;
        webpackConfig.optimization.minimizer = [];
      }
 
      // 修改 CSS 文件名
      const cssPlugin = webpackConfig.plugins.find(
        (plugin) => plugin.constructor.name === 'MiniCssExtractPlugin'
      );
      if (cssPlugin) {
        cssPlugin.options.filename = 'static/css/[name].css';
        cssPlugin.options.chunkFilename = 'static/css/[name].chunk.css';
      }
 
      return webpackConfig;
    },
  },
};